package view;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import entity.User;
import java.awt.BorderLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JPopupMenu;
import javax.swing.event.TableModelListener;

/**
 * @author s759487
 * @version 1.0
 * @created 11-Apr-2011 16:31:11
 */
public class UserDetailView extends JFrame {

    /**
     *
     */
    private static final long serialVersionUID = -5129650954233150579L; 
	//Kann man diese ID zwei Nal benutzen?
    private User user;
    //private static String[] items = {"active","blocked","blacklisted"};

    public UserDetailView(User user, TableModelListener tbl) {
        setLayout(new BorderLayout());
        this.user = user;
        setSize(600, 200);
        String[] headlines = {"Id", "Name", "Nachname", "Status"};
        Object[][] data = new Object[1][4];
        data[0][0] = user.getUserId() + "";
        data[0][1] = user.getVorName();
        data[0][2] = user.getNachName();
        data[0][3] = user.getState();
        JTable jt = new JTable(data, headlines);
        jt.getModel().addTableModelListener(tbl);
        JScrollPane js = new JScrollPane(jt);
        add(js);
        setVisible(true);
    }

    public User getUser() {
        return null;
    }

    /**
     *
     * @param book
     */
    public void setUser(User user) {
    }
}

